Click on Images above to see the build photos and Design notes
Click on Links below for the Circuit Python code
Video Demo code - Inverse kinematic movements followed by IK walk
Video Demo code - Wobble board
Video Demo code - Inverse kinematics walk
Interpolated movements: height > height and slew > height, slew and elevation > height, slew, elevation and roll
From my PDF page 3 - Height
knee = acos(1 - ((height * height) / 5000))
hip = knee / 2
From my PDF page 5 - ADD Slew
height_slew = sqrt((height * height) + (slew * slew))
knee = acos(1 - ((height_slew * height_slew) / 5000))
hip = (knee / 2) + atan(slew / height)
From my PDF page 7 - ADD Elevation
if elev != 0:
F_height = height - elev
B_height = height + elev
hip_offset = asin(elev / 49)
else:
F_height = height
B_height = height
hip_offset = 0
F_height_slew = sqrt((F_height * F_height) + (slew * slew))
B_height_slew = sqrt((B_height * B_height) + (slew * slew))
F_knee = acos(1 - ((F_height_slew * F_height_slew) / 5000))
B_knee = acos(1 - ((B_height_slew * B_height_slew) / 5000))
F_hip = (F_knee / 2) + atan(slew / F_height) + hip_offset
B_hip = (B_knee / 2) + atan(slew / B_height) + hip_offset
ADD Roll
if elev != 0:
F_height = height - elev
B_height = height + elev
hip_offset = asin(elev / 49)
else:
F_height = height
B_height = height
hip_offset = 0
F_height_slew = sqrt((F_height * F_height) + (slew * slew))
B_height_slew = sqrt((B_height * B_height) + (slew * slew))
if roll != 0:
F_L_height = F_height_slew - roll
F_R_height = F_height_slew + roll
B_L_height = B_height_slew - roll
B_R_height = B_height_slew + roll
else:
F_L_height = F_height_slew
F_R_height = F_height_slew
B_L_height = B_height_slew
B_R_height = B_height_slew
F_L_knee = acos(1 - ((F_L_height * F_L_height) / 5000))
F_R_knee = acos(1 - ((F_R_height * F_R_height) / 5000))
B_L_knee = acos(1 - ((B_L_height * B_L_height) / 5000))
B_R_knee = acos(1 - ((B_R_height * B_R_height) / 5000))
F_L_hip = (F_L_knee / 2) + atan(slew / F_L_height) + hip_offset
F_R_hip = (F_R_knee / 2) + atan(slew / F_R_height) + hip_offset
B_L_hip = (B_L_knee / 2) + atan(slew / B_L_height) + hip_offset
B_R_hip = (B_R_knee / 2) + atan(slew / B_R_height) + hip_offset
Inverse Kinematics: Python 3.9.2 code to understand and generate trajectories
From my PDF page 8 - INVERSE KINEMATICS
from numpy import *
drop = 60 # y
slew = -20 # x
hypotenuse = sqrt(drop**2+slew**2)
phi_1 = arccos((hypotenuse**2)/(100*hypotenuse))
phi_2 = arctan(slew/drop)
hip = 90+(rad2deg(phi_2-phi_1))
knee = rad2deg(arccos(1-((hypotenuse**2)/5000)))
print('hip: ', hip, ' knee: ', knee)
From my PDF page 12 - CIRCLE FOR FOOT TRAJECTORY
import matplotlib.pyplot as plt
import numpy as np
r = 60
drop = 105
def xy(r,phi):
return r*np.cos(phi), r*np.sin(phi) - drop
fig = plt.figure()
ax = fig.add_subplot(111,aspect='equal')
phis=np.arange(0,6.28,0.01)
for x in range(-40, 41, 1):
y = np.sqrt((r**2) - (x**2)) - drop
print(x,round(-y, 1))
ax.plot( *xy(r,phis), c='r',ls='-' )
plt.show()